package cn.redsoft.wechatapi.msg.req;

public enum RequestMsgType {
	TEXT("text"), // 文本
	IMAGE("image"), // 图片
	VOICE("voice"), // 语音
	VIDEO("video"), // 视频
	SHORT_VEDIO("shortvideo"), // 小视频
	LOCATION("location"), // 地理位置
	LINK("link"), // 链接
	EVENT("event")// 事件
	;
	private RequestMsgType(String v) {
		this.value = v;
	}

	private String value;

	public String getValue() {
		return value;
	}

	public static RequestMsgType toEnum(String str) {
		try {
			return Enum.valueOf(RequestMsgType.class, str);
		} catch (Exception ex) {
			for (RequestMsgType period : RequestMsgType.values()) {
				if (period.getValue().equalsIgnoreCase(str)) {
					return period;
				}
			}
			throw new IllegalArgumentException("Cannot convert <" + str
					+ "> to TimePeriod enum");
		}
	}
}
